package com.terrace.web.model;

import java.io.Serializable;
import java.util.List;

import com.terrace.core.mybatis.entity.Pagination;

/**
 * easyui网格返回JSON数据
 * @author jiangyg
 *
 */
public class DataGrid<T> implements Serializable {
	
	private static final long serialVersionUID = -2421394843394733305L;

	/**
	 * 总记录数
	 */
	private int total;
	
	/**
	 * 结果集
	 */
	private List<T> rows;

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}
	
	public void setPagination(Pagination<T> pagination) {
		this.total = pagination.getTotal();
		this.rows = pagination.getResult();
	}

}
